package cn.itcast.www.struts2Test;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class ExceptionTestAction extends ActionSupport{
	private String userName;

	public String home(){
		return "home";
	}
	public String testException(){
		/*ServletActionContext.getResponse().setCharacterEncoding("utf-8");
		StringBuffer url = ServletActionContext.getRequest().getRequestURL();
		System.out.println(url.toString());
		throw new RuntimeException("测试");*/
		ActionContext.getContext().getValueStack().set("message", "欢迎你"+ userName);
		return "test";
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}
	
}
